package com.diu.test.infrastructure;

import com.diu.domain.strategy.service.armory.IStrategyArmory;
import com.diu.domain.strategy.service.armory.IStrategyDispatch;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * @author diu
 * @description 测试测试策略奖品
 * @create_time 2025/10/3 17:52
 */
@SpringBootTest
@Slf4j
public class StrategyAwardTest {
    @Resource
    private IStrategyArmory strategyArmory;
    @Resource
    private IStrategyDispatch strategyDispatch;

    @Test
    public void test_queryStrategyAwardList() {
        // 使用 100002 策略（概率分布）,配置策略表
        strategyArmory.assembleLotteryWeightStrategy(100001L);
        // 测试获取随机奖品
        log.info("测试结果：{} - 6000 策略配置", strategyDispatch.getRandomAwardId(100001L, "6000"));
        log.info("测试结果：{} - 4000 策略配置", strategyDispatch.getRandomAwardId(100001L, "4000"));
        log.info("测试结果：{} - 5000 策略配置", strategyDispatch.getRandomAwardId(100001L, "5000"));
    }
}
